package com.xzx.spark.test

/**
 *
 * ${DESCRIPTION}
 *
 * @author xinzhixuan
 * @version 1.0
 * @date 2021-07-09 3:11 下午
 */
class Person {

  var name:String = _
  var age:Int =_

  override def equals(obj: Any): Boolean = {
    if (!obj.isInstanceOf[Person]) {
      return false
    }
    val person = obj.asInstanceOf[Person]
    this.name == person.name && this.age == person.age
  }
}

object Person {
  def apply(name:String, age:Int): Person = {
    val person = new Person()
    person.name = name
    person.age = age
    person
  }
}
